package scala40rules;

import java.util.ArrayList;

public class SuitList {

	private ArrayList<String> suitList= new ArrayList<String>();
	
	public SuitList(){
		suitList.add("hearts");
		suitList.add("clubs");
		suitList.add("diamonds");
		suitList.add("spades");
	}


	public ArrayList<String> getSuitList() {
		return suitList;
	}


	public void setSuitList(ArrayList<String> suitList) {
		this.suitList = suitList;
	}


	public String getSuit(int i){
		String suit = null;
		try{
			suit = this.suitList.get(i);
		}catch (IndexOutOfBoundsException e) {
			System.out.println("[SuitList] lista outOfBound in getSeme");
		}
		return suit;
	}


	public int size(){
		//return this.size();
		return suitList.size();
	}


    public void remove(int quale){
        suitList.remove(quale);
    }


    public void remove(String suit){
        for(int i=0; i<suitList.size(); i++){
            if(suitList.get(i).equals(suit)){
                suitList.remove(i);
            }
        }
    }


}
